#pragma once

#include <map>
#include <glm/glm.hpp>

class CMap
{
public:
	CMap(const char* cMapTile,  uint32_t unMapWidth)
		: m_unMapWidth(unMapWidth), m_unMapHeight(strlen(cMapTile) / unMapWidth)
	{

	}

	void BuildMapping(char ckey, const glm::vec2& rCoordIdx)
	{
		m_mapVec.insert(std::pair<char, glm::vec2>(ckey, rCoordIdx));
	}

	const glm::vec2* GetMapping(char cKey)
	{
		std::map<char, glm::vec2>::iterator iter = m_mapVec.find(cKey);

		if (iter != m_mapVec.end())
		{
			return &(iter->second);
		}

		return nullptr;
	}

	inline uint32_t GetMapWidth()
	{ 
		return m_unMapWidth;
	}

	inline uint32_t GetMapHeight()
	{
		return m_unMapHeight;
	}

private:
	std::map<char, glm::vec2> m_mapVec;

	uint32_t m_unMapWidth;
	uint32_t m_unMapHeight;
};